<iframe src="Page/customermanage/trajectory/baidueyes/manager.html" style="width: 100%;height: 800px;border: none;">
	
	
</iframe>









































<!--<div class="panel-body">
	<div class="table-responsive">
		<div class="dataTables_wrapper form-inline" id="dataTables-example_wrapper" role="grid">
			<div class="row" style="padding-bottom: 15px">
				<div class="col-sm-6">
					<div class="dataTables_length" id="dataTables-example_length">
						<select name="dataTables-example_length" class="form-control input-sm" aria-controls="dataTables-example" id="area" onchange="changearea()">
							<option value="">区/县</option>
						</select>
						<select name="dataTables-example_length" class="form-control input-sm" aria-controls="dataTables-example" id="work" onchange="changeTwon()">
							<option value="">分局</option>
						</select>
						<select name="dataTables-example_length" class="form-control input-sm" aria-controls="dataTables-example" id="wangge">
							<option value="">网格</option>
						</select>
						<select name="dataTables-example_length" id="customer" class="form-control input-sm" aria-controls="dataTables-example">
							<option value="">商客经理</option>
						</select>
						<a class="btn btn-serch"> <i class="fa fa-search"></i> 查 询</a>
					</div>
				</div>
				<div class="col-sm-6">
				</div>
			</div>
			<div id="trajectory" style="height: 720px;width: 100%">

			</div>
		</div>
	</div>

</div>
<script>
	var map = new BMap.Map("trajectory"); // 创建Map实例
	$(function() {
		// map.setMapStyle({
		//     style: 'googlelite'
		// });
		map.centerAndZoom(new BMap.Point(104.762014, 31.467003), 15); // 初始化地图,设置中心点坐标和地图级别
		// map.setCurrentCity("绵阳"); // 设置地图显示的城市 此项是必须设置的
		map.enableScrollWheelZoom(true); //开启鼠标滚轮缩放
		SetTrajectory();

		//       var myP1 = new BMap.Point(104.745341,31.455329);    //起点
		//       var myP2 = new BMap.Point(104.777105,31.477967);    //终点
		//       var myIcon = new BMap.Icon("http://lbsyun.baidu.com/jsdemo/img/Mario.png", new BMap.Size(32, 70), {    //小车图片
		//          imageOffset: new BMap.Size(0, 0)    //图片的偏移量。为了是图片底部中心对准坐标点。
		//       });
		//      var driving2 = new BMap.DrivingRoute(map, {renderOptions:{map: map, autoViewport: true}});    //驾车实例
		//       driving2.search(myP1, myP2);    //显示一条公交线路
		//      //
		//      window.run = function (){
		//          var driving = new BMap.DrivingRoute(map);    //驾车实例
		//          driving.search(myP1, myP2);
		//          driving.setSearchCompleteCallback(function(){
		//              var pts = driving.getResults().getPlan(0).getRoute(0).getPath();    //通过驾车实例，获得一系列点的数组
		//              var paths = pts.length;    //获得有几个点
		//
		//              var carMk = new BMap.Marker(pts[0],{icon:myIcon});
		//              map.addOverlay(carMk);
		//              i=0;
		//              function resetMkPoint(i){
		//                  carMk.setPosition(pts[i]);
		//                  if(i < paths){
		//                      setTimeout(function(){
		//                          i++;
		//                          resetMkPoint(i);
		//                      },100);
		//                  }
		//                  // else if(i>=paths){
		//                  //     map.removeOverlay(carMk);
		//                  //     run();
		//                  // }
		//              }
		//              setTimeout(function(){
		//                  resetMkPoint(5);
		//              },100)
		//
		//          });
		//      }
		//      run();
		//setInterval(run,6000);
		Getcustomer();
		GetArea();
	});
	
	//轨迹绘制
	function SetTrajectory(){
		$.ajax({
			url: GLOBAL.URL + "/shopinfo/listTree",
			type: 'get',
			data: {
				"limit": 100,
				"page": 1,
				"name": ""
			},
			dataType: "json", //返会值的类型
			async: false,
			xhrFields: {
				withCredentials: true
			},
			crossDomain: true,
			success: function(datas, textStatus) { //请求成功执行的代码
				var pointList = [];
				for(var i = 0; i < datas.page.list[0].length; i++) {
					pointList.push(new BMap.Point(datas.page.list[0][i].lon,datas.page.list[0][i].lat));
				}
				var polyline = new BMap.Polyline(pointList, {
					strokeColor: "blue",
					strokeWeight: 2,
					strokeOpacity: 0.5
				}); //创建线
				map.addOverlay(polyline);//添加到地图

			}
		});
	}


	//获取区县
	function GetArea() {
		var json = {
			url: GLOBAL.URL + "/guidinfo/getAreaList",
			type: 'post',
			data: {
				"queryType": 0,
				"scope": 0
			},
			successfn: function(data) {
				SetArea(data.data);
			},
			errorfn: function() {
				//ajaxUpdataTable();
				//$.ligerDialog.warn("系统繁忙，请稍候再试");
			}
		};
		ajaxdata(json);
	}

	function SetArea(data) {
		var str = '<option value="">区/县</option>';
		for(var i = 0; i < data.length; i++) {
			str += '<option value="' + data[i].area + '">' + data[i].area + '</option>';
		}
		$("#area").html(str);
	}
	//区县点击
	function changearea() {
		if($("#area").val() == "") {
			$("#work").html('<option value="">分局</option>');
			$("#wangge").html('<option value="">网格</option>');
		} else {
			GetWork($("#area").val());
		}
	}
	//获取分局
	function GetWork(areastr) {
		var json = {
			url: GLOBAL.URL + "/guidinfo/getAreaList",
			type: 'post',
			data: {
				"area": areastr,
				"queryType": 1,
				"scope": 0
			},
			successfn: function(data) {
				SetWork(data.data);
			},
			errorfn: function() {
				//ajaxUpdataTable();
				//$.ligerDialog.warn("系统繁忙，请稍候再试");
			}
		};
		ajaxdata(json);
	}

	function SetWork(data) {
		var str = '<option value="">分局</option>';
		for(var i = 0; i < data.length; i++) {
			str += '<option value="' + data[i].town + '">' + data[i].town + '</option>';
		}
		$("#work").html(str);
	}
	//分局点击
	function changeTwon() {
		if($("#area").val() == "" || $("#work").val() == "") {
			$("#wangge").html('<option value="">网格</option>');
		} else {
			Getwangge($("#area").val(), $("#work").val());
		}
	}
	//获取网格
	function Getwangge(areastr, workstr) {
		var json = {
			url: GLOBAL.URL + "/guidinfo/getAreaList",
			type: 'post',
			data: {
				"area": areastr,
				"town": workstr,
				"queryType": 2,
				"scope": 0
			},
			successfn: function(data) {
				SetWangge(data.data);
			},
			errorfn: function() {
				//ajaxUpdataTable();
				//$.ligerDialog.warn("系统繁忙，请稍候再试");
			}
		};
		ajaxdata(json);
	}

	function SetWangge(data) {
		var str = '<option value="">网格</option>';
		for(var i = 0; i < data.length; i++) {
			str += '<option value="' + data[i].branch_office + '">' + data[i].branch_office + '</option>';
		}
		$("#wangge").html(str);
	}

	//获取所有商客经理
	function Getcustomer() {
		var json = {
			url: GLOBAL.URL + "/customer/list",
			type: 'post',
			data: {
				"page": 1,
				"limit": 1000000,
				"area": "",
				"town": ""
			},
			successfn: function(data) {
				Setcustomer(data.page.list);
			},
			errorfn: function() {
				//ajaxUpdataTable();
				//$.ligerDialog.warn("系统繁忙，请稍候再试");
			}
		};
		ajaxdata(json);
	}

	function Setcustomer(data) {
		var str = '<option value="">商客经理</option>';
		for(var i = 0; i < data.length; i++) {
			str += '<option value="' + data[i].real_name + '">' + data[i].real_name + '</option>';
		}
		$("#customer").html(str);
	}
</script>-->